class Users::RegistrationsController < Devise::RegistrationsController

  def update
    if user_signed_in?
      if current_user.update(user_params)
        # Handle successful update
        redirect_to user_path(current_user), notice: "Your profile was successfully updated."
      else
        # Handle failed update
        render :edit
      end
    else
      # Handle unauthorized update attempt
      redirect_to new_user_session_path, alert: "You must be signed in to update your profile."
    end
  end

  
  

  protected

  
  def user_params
    params.require(:user).permit(:contact, :note, :region, :qrcode)
  end
  
end